package com.zcxy.fast.controller;


import cn.hutool.core.util.IdUtil;

import com.zcxy.fast.bean.Response;

import com.zcxy.fast.entity.SysUser;
import com.zcxy.fast.mapper.SysUserMapper;
import com.zcxy.fast.pojo.LoginVo;
import com.zcxy.fast.service.ISysUserService;
import com.zcxy.fast.utils.RedisUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * @author zcc
 * @version 1.0.0
 * @ClassName LoginController.java
 * @Description 用户
 * @createTime 2020-06-01
 */
@RestController
@RequestMapping("/sys")
@Api(tags = "<font  color='red'>登录相关接口</font>")
@Slf4j
public class LoginController {
    @Autowired
    private ISysUserService iSysUserService;
    @Autowired
    private RedisUtils redisUtils;






    @PostMapping(value = "/login")
    @ApiOperation(value = "登录", notes = "登录")
    public Response<LoginVo> login(@RequestBody SysUser sysUser) {
        return Response.ok(iSysUserService.login(sysUser));
    }



/*
    @ApiOperation("登出")
    @PostMapping(value = "/loginout")
    public Response LoginOut() {
        iSysUserService.LoginOut();
        return Response.ok();
    }
*/



}
